/* 全局重置与基础样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

body {
  /* background-color: #f5f7fa; */
  color: #333;
}

.container {
  display: flex;
  min-height: 100vh;
}

/* 左侧侧边栏 */
.sidebar {  
  width: 240px;
  background-color: #fff;
  padding: 16px;
}

.sidebar-header {
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-header h2 {
  margin-right: 8px;
  font-size: 18px;
  font-weight: weight;
  color: #27254c;
}

.service-type {
  display: flex;
  font-size: 12px;
  color: #555;
  background: #f3f5f9;
  border-radius: 4px;
  overflow: hidden;
}

.tag {
  margin-left: 0;
  padding: 2px 6px;
  font-size: 12px;
  /* color: #555; */
  /* background-color: #f3f5f9; */
  border: none;
  cursor: pointer;
}

.tag.active {
  color: #fff;
  background-color: #6e56cf;
  border-color: #6e56cf;
  border-radius: 4px;
}

.sidebar-nav ul {
  list-style: none;
}

.nav-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding: 8px 8px;
  font-size: 14px;
  font-weight: bold;
  /* color: #555; */
  background: #f3f5f9;
  border-radius: 8px;
  cursor: pointer;
}

.nav-item:hover {
  color: #6e56cf;
}
.nav-item.active {
  color: #fff;
  background-color: #6e56cf;
}

.nav-count {
  padding: 2px 8px;
  font-size: 12px;
  font-weight: normal;
  color: #555;
  background: #ffffff;
  border-radius: 12px;
}

/* 右侧主内容区 */
.main {
  flex: 1;
  padding: 16px;
}

.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.main-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-bar {
  display: flex;
  align-items: center;
  color: #000000e0;
  background: #f3f5f9;
  border-radius: 4px;
}
.search-bar:hover {
  background: transparent;
  outline: 1px solid #624aff;
}

.search-icon {
  padding: 8px 0 8px 12px;
  color: #6e56cf;
  font-size: 12px !important;
}

.search-input {
  width: 360px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  font-size: 14px;
}
.search-input:focus {
  outline: none;
}



.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.service-card {
  display: flex; flex-direction: column;
  padding: 16px;               
  background-color: #fff;
  border: 1px solid #eaecef; border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  cursor: hover;
}

.service-card:hover {
  border: 2px solid #6e56cf;
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.card-badges {
  display: flex;
  gap: 4px;
}

.badge {
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  color: #fff;
}

.badge.hosted {
  background-color: #6e56cf;
}

.badge.local {
  background-color: #4caf50;
}

.card-meta {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
  color: #888;
}

.card-meta span {
  margin-right: 8px;
}

.card-desc {
  flex: 1;
  margin-bottom: 12px;
  line-height: 1.4;
  font-size: 14px;
  color: #555;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #888;
}

.card-footer a {
  color: #6e56cf;
  text-decoration: none;
}

.card-stats {
  display: flex;
  gap: 16px;
}

.stat-item {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.stat-item svg {
  margin-right: 4px;
}

/* 加载更多 */
.load-more {
  margin: 16px auto;
  padding: 2px 8px;
  display: block;
  color: #4e5969;
  background-color: white;
  border: 1px solid #e5e9ef;
  border-radius: 4px;
  font-size: 12px;
  transition: all 0.2s;
  cursor: pointer;
}

.load-more:hover {
  border-color: #6e56cf;
  color: #6e56cf;
}

/* 模态框样式 */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: #fff;
  /* margin: auto; */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 0;
  border-radius: 8px;
  width: 840px;
  max-width: 90%;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid #eaecef;
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.close {
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  color: #888;
}

.close:hover {
  color: #333;
}

.modal-body {
  padding: 16px 24px;
}

#mcpForm {
  margin-top: -16px;
  padding: 8px 0;
  max-height: calc(100vh - 150px);
  overflow: auto;
}

.form-group {
  margin-bottom: 8px;
}

.form-group label {
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
  font-size: 14px;
  color: #333;
}
.form-group:has(:required) label::before {
  display: inline-block;
  content: "* ";
  color: red;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 6px 4px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #6e56cf;
}

.form-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

.btn-primary,
.btn-secondary {
  margin-left: 12px;
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.btn-primary {
  background-color: #6e56cf;
  color: white;
}

.btn-secondary {
  background-color: #f3f5f9;
  color: #666;
}

.upload-area {
  margin: auto;
  width: 80%;
  line-height: 60px;
  text-align: center;
  outline: 2px dashed #dcdfe6;
  border-radius: 4px;
  cursor: pointer;
}